<template>
	<view>
		<view style="padding-left: 30rpx;">
			<image src="../../static/renwu.png" class="ti"></image>
		</view>
		<view class="adbox">
			<view class="title">
				每日任务
			</view>
			<view class="item">
				<view class="lbox">
					<image src="../../static/renwu2.png" class="img"></image>
				</view>
				<view class="cbox">
					<view class="kt">观看广告</view>
					<view class="kz">观看5处不同位置的广告</view>
					<view class="sb">
						<view class="ss"><view :style="{width: anum+'rpx'}"></view></view>
						<view class="numbox"><text class="yellow">{{info.other_num.finish}}</text>/<text>{{info.other_num.total}}</text></view>
					</view>
				</view>
				<view class="btnbox">
					<view class="btn" @click="ad">去观看</view>
				</view>
			</view>
			<view class="item">
				<view class="lbox">
					<image src="../../static/renwu1.png" class="img"></image>
				</view>
				<view class="cbox">
					<view class="kt">激励视频</view>
					<view class="kz">10个不同类型的激励视频</view>
					<view class="sb">
						<view class="ss"><view :style="{width: vnum+'rpx'}"></view></view>
						<view class="numbox"><text class="yellow">{{info.video_num.finish}}</text>/<text>{{info.video_num.total}}</text></view>
					</view>
				</view>
				<view class="btnbox">
					<view class="btn" @click="jl">去观看</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {renwu} from "@/api/product";
	export default{
		data() {
			return {
				info:null,
				anum:0,
				vnum:0
			}
		},
		onLoad() {
			this.get()
		},
		methods: {
			get(){
				this.$post(renwu).then(r=>{
					this.info=r.data
					this.anum=(parseInt(this.info.other_num.finish)/parseInt(this.info.other_num.total))*240
					console.log(this.anum)
					this.vnum=(parseInt(this.info.video_num.finish)/parseInt(this.info.video_num.total))*240
					console.log(this.vnum)
					console.log(r)
				})
			},
			ad(){
				uni.showToast({
					title:"到页面观看广告",
					icon:"none"
				})
			},
			jl(){
				uni.showToast({
					title:"点击首页激励视频观看",
					icon:"none"
				})
			}
		}
	}
</script>

<style >
	.yellow{
		color: #FF743E;
	}
	.btn{
		width: 140rpx;
		height: 58rpx;
		background: linear-gradient(180deg, #FFB966 0%, #FFAF60 12%, #FF8447 70%, #FF743E 100%);
		opacity: 1;
		border-radius: 29rpx;
		text-align: center;
		line-height: 58rpx;
		color: #FFFFFF;
		font-size: 24rpx;

	}
	.btnbox{
		height: 100%;
		display: flex;
		align-items: center;
	}
	.ss{
		width: 240rpx;
		height: 10rpx;
		background: #D1D1D1;
		opacity: 1;
		border-radius: 5rpx;
		margin-right: 10rpx;
		overflow: hidden;
	}
	.ss>view{
		background-color:#FF743E ;
		height: 10rpx;
	}
	.sb{
		display: flex;
		align-items: center;
	}
	.kz{
		height: 28rpx;
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: 400;
		line-height: 28rpx;
		color: #999999;
		opacity: 1;
		margin-top: 30rpx;

	}
	.kt{
		width: 120rpx;
		height: 42rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight:bold;
		line-height: 42rpx;
		color: #333333;
		opacity: 1;


	}
	.cbox{
		width:450rpx;
		margin-left: 30rpx;
	}
	.img{
		width:44rpx;
		height: 44rpx;
	}
	.item{
		width: 100%;
		display: flex;
		padding: 30rpx 0;
	}
	.title{
		font-size: 32rpx;
		font-family: PingFang SC;
		line-height: 32rpx;
		font-weight: bold;
		color: #333333;
		opacity: 1;
		border-left: 6rpx #EA912B solid;
		padding-left:  30rpx;

	}
	.adbox{
		width: 690rpx;
		background: #FFFFFF;
		box-shadow: 0px 0px 20rpx rgba(77, 77, 77, 0.1);
		opacity: 1;
		border-radius: 12rpx;
		margin: 0 auto;
		padding: 30rpx;
		box-sizing: border-box;
	}
	.ti{
		width: 690rpx;
		height: 372rpx;
		margin: 20rpx 0;
	}
	page{
		background-color: #FFFFFF;
	}
</style>
